//
//  micros.h
//  YTwallet
//
//  Created by hadrlog on 2019/2/22.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#ifndef micros_h
#define micros_h

#define APPDELEGETE         ((AppDelegate*)[[UIApplication sharedApplication] delegate])
#define WBColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a]
#define WBDefault WBColor(45, 189, 228, 1)

#pragma mark - Frame
#define WIDTH_SCREEN        [UIScreen mainScreen].bounds.size.width
#define HEIGHT_SCREEN       [UIScreen mainScreen].bounds.size.height
#define HEIGHT_STATUSBAR    20
#define HEIGHT_TABBAR       49
#define HEIGHT_NAVBAR       44
#define HEIGHT_CHATBOXVIEW  215

#define GetMessage_timeout 30 //获取验证码时间长度

#pragma mark - Color
#define     DEFAULT_NAVBAR_COLOR             WBColor(20.0, 20.0, 20.0, 0.9)
#define     DEFAULT_BACKGROUND_COLOR         WBColor(239.0, 239.0, 244.0, 1.0)

#define     DEFAULT_CHAT_BACKGROUND_COLOR    WBColor(235.0, 235.0, 235.0, 1.0)
#define     DEFAULT_CHATBOX_COLOR            WBColor(244.0, 244.0, 246.0, 1.0)
#define     DEFAULT_SEARCHBAR_COLOR          WBColor(239.0, 239.0, 244.0, 1.0)
#define     DEFAULT_GREEN_COLOR              WBColor(2.0, 187.0, 0.0, 1.0f)
#define     DEFAULT_TEXT_GRAY_COLOR         [UIColor grayColor]
#define     DEFAULT_LINE_GRAY_COLOR          WBColor(188.0, 188.0, 188.0, 0.6f)

#pragma mark - Path
#define     PATH_DOCUMENT                   [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]
#define     PATH_CHATREC_IMAGE              [PATH_DOCUMENT stringByAppendingPathComponent:@"ChatRec/Images"]

#define AES_KEY @"1234567891234567" //AES加密秘钥
#define MD5_NomalKey @"rutaiMD5"  //正常md5 key

#define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? YES : NO)

//#define MD5_PasswordKey @"ru!@#*1008+71@paySHANGHAI"  //开发登录密码md5 key
#define MD5_PasswordKey @"ru!@#*1008+71@paySHANGHAI"

#define MD5_PayKey @"pay@%!&*+=PARs*HAnd3434AQ"   //支付密码md5

#define allPort @"http://gw.bitbonds.cn/"   //开发测试平台
//#define allPort @"http://gw.rutaipay.com.cn/"  //开发生产平台
#define isbindToken @"tokenisbind"  //绑定token no 需要绑定 yes 不需要绑定



#define MytostWithTitle(title,time)   CGPoint p = self.view.center; p.y += 200;\
CSToastStyle *s= [[CSToastStyle alloc] initWithDefaultStyle];\
s.backgroundColor = [UIColor lightGrayColor];\
[ self.view makeToast:title duration:time position:[NSValue valueWithCGPoint:(CGPoint)p] style:s];

#define STORE_USENAME @"USERNAME"  //存储用户名
#define STORE_PASSWORD @"USERKEY"   //存储加密后的密码
#define IF_STORE @"STORESTATION"    //是否存储
#define setionKey @"SECTIONKEY"  //存储section
#define FIRST_LOAD @"firstLoad"  //第一次登录

#define myDotNumbers     @"0123456789.\n"  //金额
#define myNumbers          @"0123456789\n" //数字

#define FIRSTSELECT_MACHINE @"first_load_machine"  //未点击状态下，设备自动智能选择
/*----------------------设备文件存储-----------------------------*/
//当前设备存储地址路径
#define USING_MPOS_STORE_PATH  [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:@"mpos.archive"]
#define ALL_MPOS_STORE_PATH  [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:@"allmpos.archive"]


/*-----------------------设备文件配置节点属性------------------------*/
//字体大小
#define CYFontB(f) [UIFont boldSystemFontOfSize:(f)]
#endif

// 图片路径
#define CYPasswordViewSrcName(file) [@"CYPasswordView.bundle" stringByAppendingPathComponent:file]

#ifdef DEBUG  //调试阶段
#define MYLog(...)  NSLog(__VA_ARGS__)
#else //发布阶段
#define MYLog(...)
#endif

#ifndef __OPTIMIZE__
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...) {}
#endif

